﻿Imports Telerik.Web.UI
Imports System.Data
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Partial Class Egreasados_DatosPersonales_DatosPersonales
    Inherits PaginaComun

    Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
        Dim TxtDireccion As TextBox = DirectCast(FormView1.FindControl("TxtDir"), TextBox)
        Dim TxtTelefono As TextBox = DirectCast(FormView1.FindControl("TxtTel"), TextBox)
        Dim TxtTelFax As TextBox = DirectCast(FormView1.FindControl("TxtFax"), TextBox)
        Dim TxtCelular As TextBox = DirectCast(FormView1.FindControl("TxtCel"), TextBox)
        Dim CmbDptoNto As RadComboBox = DirectCast(FormView1.FindControl("CmbDptoNac"), RadComboBox)
        Dim CmbEstadoCivil As RadComboBox = DirectCast(FormView1.FindControl("CmbEstCivil"), RadComboBox)
        Dim CmbGruSan As RadComboBox = DirectCast(FormView1.FindControl("CmbSangre"), RadComboBox)
        Dim CmbSex As RadComboBox = DirectCast(FormView1.FindControl("CmbSexo"), RadComboBox)
        Dim CmbDptoRes As RadComboBox = DirectCast(FormView1.FindControl("CmbDptoUbi"), RadComboBox)
        Dim CmbMunNto As RadComboBox = DirectCast(FormView1.FindControl("CmbMunNac"), RadComboBox)
        Dim CmbMunRes As RadComboBox = DirectCast(FormView1.FindControl("CmbMunUbi"), RadComboBox)
        Dim CmbRel As RadComboBox = DirectCast(FormView1.FindControl("CmbReligion"), RadComboBox)
        Dim DtpFecNaci As RadDatePicker = DirectCast(FormView1.FindControl("DtpFecNac"), RadDatePicker)
        Dim txttarp As TextBox = DirectCast(FormView1.FindControl("TxtTP"), TextBox)
        Dim obj As New Egresados
        obj.DIRECCION = TxtDireccion.Text
        obj.TELEFONO = TxtTelefono.Text
        obj.CELULAR = TxtCelular.Text
        obj.MCPIO_NTO = CmbMunNto.SelectedValue
        obj.MCPIO_RESIDENCIA = CmbMunRes.SelectedValue
        obj.DPTO_NTO = CmbDptoNto.SelectedValue
        obj.DPTO_RESIDENCIA = CmbDptoRes.SelectedValue
        obj.FAX = TxtTelFax.Text
        obj.FEC_NTO = DtpFecNaci.SelectedDate
        obj.ESTADO_CIVIL = CmbEstadoCivil.SelectedValue
        obj.RELIGION = CmbRel.SelectedValue
        obj.GRUPO_SANGUINEO = CmbGruSan.SelectedValue
        obj.SEXO = CmbSex.SelectedValue
        obj.TP = txttarp.Text
        MsgModalPanel.Text = obj.Update
        If obj.lErrorG = False Then
            ImgRst.ImageUrl = "~/imagenes/good.png"
        Else
            ImgRst.ImageUrl = "~/imagenes/error.png"
        End If
        ModalPopup.Show()
    End Sub
    Protected Sub ImageButton2_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
        Dim obj As New Egresados
        Dim obj1 As New ExperienciaLaboral
        Dim obj2 As New Estudios
        Dim obj3 As New Idiomas
        Dim obj4 As New Reconocimientos
        Dim dt As DataTable = obj.GetEgresado
        Dim dt1 As DataTable = obj1.GetxEgresado
        Dim dt2 As DataTable = obj2.GetxEgresado
        Dim dt3 As DataTable = obj3.GetxEgresado
        Dim dt4 As DataTable = obj4.GetxEgresado
        dt.TableName = "Estudiante"
        dt1.TableName = "Experiencia"
        dt2.TableName = "Estudios"
        dt3.TableName = "Idiomas"
        dt4.TableName = "Reconocimientos"
        Dim Reporte As New ReportDocument
        Dim ds As New DataSet
        ds.Tables.Add(dt.Copy)
        ds.Tables.Add(dt1.Copy)
        ds.Tables.Add(dt2.Copy)
        ds.Tables.Add(dt3.Copy)
        ds.Tables.Add(dt4.Copy)
        Reporte.Load(Publico.RutaRpt & "RptHV.rpt")
        Reporte.SetDataSource(ds)
        Reporte.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, True, "Hv_" & dt.Rows(0)("Cedula").ToString)
    End Sub
End Class
